<?php
//包含数据库配置文件
include '../../public/dbconfig.php';
//包含函数库文件
include '../../public/func.inc.php';

$link = conn();
//var_dump($link);
//exit;
//分区id
$pid = $_POST['pid'];

//版块名称
$cname = $_POST['cname'];
//版块添加时间
$ctime = time();

$sql = "insert into bbs_cate(pid,cname,ctime) values('{$pid}','{$cname}','{$ctime}')";

if(mysqli_query($link, $sql)){
	echo '<script>alert("添加版块成功");window.location.href="list.php";</script>';
}else{
	echo '<script>alert("添加版块失败");window.location.href="add.php";</script>';
}
mysqli_close($link);









?>
